home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume4 / se / part5 < prev    next >
Encoding:
Internet Message Format  |  1986-11-30  |  48.5 KB

  1. From: Jeff Lee <talcott!seismo!gatech!jeff>
  2. Subject: Georgia Tech 'se' screen editor (Part 5 of 8)
  3. Keywords: Software Tools, Yet Another Screen Editor, Both BSD and USG
  4. Newsgroups: mod.sources
  5. Approved: jpn@panda.UUCP
  6.  
  7. Mod.sources:  Volume 4, Issue 86
  8. Submitted by: Jeff Lee <seismo!gatech!jeff>
  9.  
  10. #! /bin/sh
  11. # This is a shell archive, meaning:
  12. # 1. Remove everything above the #! /bin/sh line.
  13. # 2. Save the resulting text in a file.
  14. # 3. Execute the file with /bin/sh (not csh) to create:
  15. #    se.m4
  16. #    scriptse.1
  17. # This archive created: Tue Apr 29 11:03:20 1986
  18. export PATH; PATH=/bin:/usr/bin:$PATH
  19. echo shar: "extracting 'se.m4'" '(46989 characters)'
  20. if test -f 'se.m4'
  21. then
  22.     echo shar: "will not over-write existing file 'se.m4'"
  23. else
  24. cat << \SHAR_EOF > 'se.m4'
  25. .ie t \{ .de CW
  26. .vs 10.5p
  27. .ta 16m/3u 32m/3u 48m/3u 64m/3u 80m/3u 96m/3u
  28. .nf
  29. .ft CW
  30. .cs CW 18
  31. .. \}
  32. .el \{ .de CW
  33. .nf
  34. .. \}
  35. .ie t \{ .de CN
  36. .ta 0.5i 1i 1.5i 2i 2.5i 3i 3.5i 4i 4.5i 5i 5.5i 6i
  37. .vs
  38. .fi
  39. .cs CW
  40. .ft
  41. .. \}
  42. .el \{ .de CN
  43. .fi
  44. .. \}
  45. changequote([])
  46. .if n .ds lq ""
  47. .if n .ds rq ""
  48. .if t .ds lq ``
  49. .if t .ds rq ''
  50. changequote
  51. .TH SE 1 ifelse(GITVAX,YES,GT-SWT,local)
  52. .SH NAME
  53. se \- screen editor
  54. .SH SYNOPSIS
  55. .B se
  56. ifelse(HARD_TERMS,YES,
  57. [
  58. .B \-t
  59. <term> ],)
  60. [ file ... ] [ \-option ... ]
  61. .SH DESCRIPTION
  62. .I Se
  63. is a screen oriented version of
  64. .IR ed (1).
  65. It accepts the same      
  66. commands with a few differences.
  67. .PP
  68. ifelse(HARD_TERMS,YES,,`divert(-1)')
  69. .I Se
  70. must be run from a CRT terminal and must be told what sort
  71. of terminal it is; hence the <term> parameter.  The terminals
  72. currently supported are:
  73. .CW
  74.     adds980   bee200   haz1510  sol      vi200
  75.     adds100   cg       hp21     trs80    vi50
  76.     adm31     esprit   ibm      ts1
  77.     adm3a     fox      isc8001  tvi950
  78.     anp       gt40     netron   tvt
  79.     bee150    h19      sbee     vc4404
  80. .CN
  81. If no terminal type is specified
  82. .I se
  83. looks to see if you have the shell variable \*(lqTERM\*(rq set; if so,
  84. .I se
  85. recognizes that value as
  86. your terminal type.
  87. ifelse(HARD_TERMS,YES,`divert(-1)',divert)
  88. .I Se
  89. must be run from a CRT terminal.
  90. To use
  91. .I se
  92. on your terminal, your terminal must be able to do cursor positioning,
  93. and there must either be an entry for your terminal in the
  94. ifelse(S5R2,YES,
  95. .B /usr/lib/terminfo/?/*
  96. database,
  97. .B /etc/termcap
  98. file)`,'
  99. or you must have the
  100. ifelse(S5R2,YES,`\*`('lqTERMINFO\*`('rq',`\*`('lqTERMCAP\*`('rq')
  101. environment variable
  102. set to
  103. ifelse(S5R2,YES,
  104. the pathname of a directory containing an entry for it,
  105. a termcap entry or the name of a file containing one)
  106. (see
  107. .IR ifelse(S5R2,YES,curses (3X),termlib (3))
  108. for details).
  109. .I Se
  110. uses the
  111. .IR ifelse(S5R2,YES,curses (3X),termlib (3))
  112. terminal operations library, which
  113. retrieves terminal capabilities from the
  114. .B ifelse(S5R2,YES, /usr/lib/terminfo, /etc/termcap)
  115. database.
  116. .I Se
  117. looks to see if you have the shell variable \*(lqTERM\*(rq set; if so,
  118. .I se
  119. recognizes that value as
  120. your terminal type.
  121. .PP
  122. .I Se
  123. will exit if any one of the following is true:
  124. .IP 1.
  125. You do not have the shell variable \*(lqTERM\*(rq set.
  126. .IP 2.
  127. The
  128. .B ifelse(S5R2,YES, /usr/lib/terminfo, /etc/termcap)
  129. database
  130. cannot be found.
  131. .IP 3.
  132. Your terminal does not have an entry in the
  133. ifelse(S5R2,YES,terminfo,termcap)
  134. database,
  135. or in the
  136. ifelse(S5R2,YES,`\*`('lqTERMINFO\*`('rq',`\*`('lqTERMCAP\*`('rq')
  137. environment variable.
  138. .IP 4.
  139. Your terminal does not have cursor motion.
  140. ifelse(HARD_TERMS,YES,divert,)
  141. .PP
  142. .I Se
  143. first
  144. clears the screen,
  145. draws in its margins,
  146. and executes the commands in the file
  147. .BR $HOME/.serc ,
  148. if it exists.
  149. It then processes the command line,
  150. obeying the options given there, and begins
  151. reading your file (if you specified one).  The screen it draws
  152. looks something like this.
  153. (The parenthesized numerals are not part of the screen layout,
  154. but are there to aid in the following discussion.)
  155. .PP
  156. .CW
  157.     (1) (2)              (3)
  158.     A     |
  159.     B     |#include <stdio.h>
  160.     C     |
  161.     D    *|   register int i;
  162.     E     |
  163.     .  -> |   for (i = 1; i <= 12; i++)
  164.     G     |      putc ('\en', stderr);
  165.     $     |
  166.     cmd>  |_  (4)
  167.     11:39   myfile  UNIX ....(5).........................
  168. .CN
  169. .PP
  170. The display is divided into five parts:
  171. (1) the line number area,
  172. (2) the mark name area,
  173. (3) the text area,
  174. (4) the command line, and
  175. (5) the status line.
  176. The current line
  177. is indicated by the symbol \*(lq.\*(rq in the
  178. line number area of the screen.
  179. In addition, a rocket
  180. .if n (\*(lq->\*(rq)
  181. .if t (\*(lq\f(CW->\fP\*(rq)
  182. is displayed to make the current line
  183. more obvious.  The current mark name of each line is shown in the
  184. markname area just to the left of the vertical bar.
  185. Other information, such as the
  186. number of lines read in, the name of the file, and the time of day, are
  187. displayed in the status line.
  188. .PP
  189. The cursor is positioned at the beginning of the command
  190. line, showing you that
  191. .I se
  192. awaits your command.  You may now enter any of the
  193. .I ed
  194. commands and 
  195. .I se
  196. will perform them, while making sure that
  197. the current line is always displayed on the screen.
  198. .PP
  199. You can set
  200. options to control the behavior of 
  201. .I se
  202. on the command line, simply by using a \*(lq\-\*(rq, followed by
  203. the option letter, and any parameters that the option may take.
  204. These options can also be set after invoking
  205. .I se
  206. with the options command, \*(lqo\*(rq, explained in detail in the section
  207. on commands. Here is a summary:
  208. .PP
  209. .CW
  210.     <opt> = a | c | d[<dir>] | f | g | h | i[a | <indent>] | k |
  211.             l[<lop>] | lm[<col>] | m | p[s | u] | s[<filetype>] |
  212.             t[<tabs>] | u[<char>] | v[<col>] | w[<col>] |
  213.             x | y[<key>] | z | -[<lnr>]
  214. .CN
  215. .PP
  216. There are only a few other things that you need know to
  217. successfully use
  218. .IR se :
  219. .IP 1.
  220. If you make an error, 
  221. .I se
  222. automatically displays an error message in
  223. the status line.  It also leaves
  224. your command line intact so that you may change it using
  225. in-line editing commands (see the \*(lqv\*(rq command).
  226. If you don't want to bother with changing the command, just hit
  227. .SM DEL
  228. to erase the command.
  229. .IP 2.
  230. The \*(lqp\*(rq command has a different meaning than in
  231. .IR ed .
  232. When used with line
  233. numbers, it displays as many of the lines
  234. in the specified range as possible (always including the last line).
  235. When used without line numbers, \*(lqp\*(rq displays  the
  236. previous page.
  237. .IP 3.
  238. The \*(lq:\*(rq command positions a specified line at the
  239. top of the screen (e.g., \*(lq12:\*(rq positions the screen so that
  240. line 12 is at the top).  If no line number is specified, \*(lq:\*(rq
  241. displays the next page.
  242. .PP
  243. Keeping these few differences in mind, you will see that
  244. .I se
  245. can perform all of the
  246. functions of
  247. .IR ed ,
  248. while giving the advantage of a \*(lqwindow\*(rq into
  249. the edit buffer.
  250. .PP
  251. When
  252. .I se
  253. is running at the School of Information and Computer Science at Georgia Tech,
  254. it starts off in Software Tools compatibility mode.
  255. In this mode, the pattern matching characters and command letters
  256. are identical to those of the version of
  257. .I se
  258. which runs on Prime computers under the Georgia Tech Software Tools Subsystem.
  259. This mode is indicated by the message \*(lqSWT\*(rq in the status line.
  260. Software Tools compatibility mode is designed to ease the transition to
  261. .SM UNIX
  262. for Georgia Tech I.C.S. users
  263. who are already familiar with the Georgia Tech
  264. Software Tools Subsystem.
  265. .PP
  266. The discussion immediately below pertains to regular expressions and command
  267. letters when in Unix mode.  Unix mode is indicated by the message
  268. \*(lqUNIX\*(rq in
  269. the status line (see the example screen above), and is the default at any
  270. place but the I.C.S. school at Georgia Tech.
  271. The \*(lqop\*(rq command, discussed below under the \*(lqo\*(rq (option)
  272. command, controls
  273. which mode
  274. .I se
  275. operates in.
  276. The discussion there indicates which characters are used for which commands
  277. when in Software Tools compatibility mode.
  278. .PP
  279. Below is a summary of line number expressions, regular expressions
  280. and commands.
  281. Where there is no difference between
  282. .IR se " and " ed
  283. no explanation is given.
  284. .SS "Line Number Expressions"
  285. .PP
  286. .TP
  287.  <n>   <n>th line.
  288. .TP
  289.  .     current line.
  290. .TP
  291.  $     last line.
  292. .TP
  293.  ^     previous line.
  294. .TP
  295.  \-     previous line.
  296. .TP 
  297.  capital letter <A>
  298. <A>th line on the screen.
  299. .I Se
  300. has a number of features that take advantage of the window
  301. display to minimize keystrokes and speed editing.
  302. In the line number area of the screen,
  303. .I se
  304. displays a capital letter
  305. for each line, but in \*(lqabsolute line number\*(rq mode (controlled by the
  306. \*(lqoa\*(rq command; see the options command)
  307. .I se
  308. displays the actual line number of each line.
  309. .TP
  310.  #  
  311. number of the first line on the screen.
  312. .TP
  313.  /regular expression[/]  next line with pattern.
  314. .TP
  315.  ?regular expression[?]  previous line with pattern.
  316. .TP
  317.  >name
  318. number of the next line having the given markname
  319. (search wraps around, like //).
  320. .TP
  321.  <name
  322. number of the previous line having the given markname
  323. (search proceeds in reverse, like ??).
  324. .TP
  325.  <expression>
  326. any of the above operands may be combined with plus
  327. or minus signs to produce a line number expression.  Plus
  328. signs may be omitted if desired (e.g., /parse/\-5, /lexical/+2,
  329. /lexical/2, $\-5, .+6, .6).
  330. Unlike
  331. .IR ed , " se"
  332. does not recognize trailing \*(lq+\*(rq or \*(lq\-\*(rq signs.  They must always
  333. be followed by a integer.  Successive \*(lq+\*(rq or \*(lq\-\*(rq signs
  334. (e.g. \*(lq\-\-\*(rq) are also not allowed.
  335. Like
  336. .IR vi (1), " se"
  337. will allow you to leave off the trailing delimiter in
  338. forward searches, backward searches, in the substitute command,
  339. the join command,
  340. and in the transliteration command (\*(lqy\*(rq or \*(lqt\*(rq,
  341. for UNIX and SWT modes
  342. respectively).
  343. This is true whether or not Software Tools compatibility mode
  344. is in effect.
  345. .SS "Regular Expression Notation"
  346. .PP
  347. .TP
  348.  ^
  349. beginning of line if first character in regular expression.
  350. .TP
  351.  .
  352. any single character other than newline.
  353. .TP
  354.  $
  355. end of line if last character in regular expression.
  356. .TP
  357.  [<ccl>] [^<ccl>]
  358. character set.
  359. .TP
  360.  *
  361. 0 or more matches of the preceding regular expression element.
  362. .TP
  363.  \e
  364. ignore special meaning of the immediately following character
  365. except \*(lq\e(\*(rq and \*(lq\e)\*(rq.
  366. .TP                 
  367.  \e(<regular expression>\e)
  368. Tags the text actually matched by the sub-pattern
  369. specified by <regular expression> for use in the replacement part
  370. of a substitute
  371. command.                          
  372. .TP
  373.  &
  374. Appearing in the replacement part of a substitute command, represents
  375. the text actually matched by the pattern part of the command.
  376. .TP
  377.  %
  378. Appearing as
  379. the only character in the replacement part,
  380. represents the replacement part used in the previous substitute command.
  381. (This allows an empty replacement pattern as well.)
  382. If there are other characters in the replacement part along with the \*(lq%\*(rq,
  383. the \*(lq%\*(rq is left alone.
  384. .TP
  385.  \e<digit>
  386. Appearing in the replacement part of a substitute command,
  387. represents the text actually matched by the tagged sub-pattern
  388. specified by <digit>.
  389. .SS File names
  390. .PP
  391. .I Se
  392. will expand environment variables which appear anywhere in
  393. a path name. Identifiers in a path name are treated as
  394. environment variables if they start with a dollar sign \*(lq$\*(rq.
  395. A real \*(lq$\*(rq can be used if it is escaped.
  396. If the named environment variable is not found, it is
  397. deleted from the path name.  This presents no difficulty,
  398. since multiple contiguous slashes are allowed in path names.
  399. The expanded path name will be placed in the status line.
  400. .SS The .serc File
  401. .PP
  402. When
  403. .I se
  404. starts up, it tries to open the file
  405. .B .serc
  406. in your home directory.
  407. If that file exists,
  408. .I se
  409. reads it, one line at a time, and executes each line as a command.
  410. changequote([])
  411. If a line has a `#' as the
  412. changequote
  413. .I first
  414. character on the line, or if the line is empty,
  415. the entire line is treated as a comment,
  416. otherwise it is executed.
  417. Here is a sample
  418. .B .serc
  419. file:
  420. .PP
  421. .CW
  422.     # turn on unix mode, tabs every 8 columns, auto indent
  423.     opu
  424.     ot+8
  425.     oia
  426. .CN
  427. .PP
  428. The
  429. .B .serc
  430. file is useful for setting up personalized options,
  431. without having to type them on the command line every time, and without
  432. using a special shell file in your bin (for
  433. .IR sh (1))ifelse(BSD,YES,`,'
  434. or a special alias (for
  435. .IR csh (1))).
  436. In particular, it is useful at the I.C.S. school at
  437. Georgia Tech for automagically turning
  438. on Unix mode, for users who are familiar with the
  439. .SM UNIX
  440. system.
  441. .PP
  442. Command line options are processed
  443. .I after
  444. commands in the
  445. .B .serc
  446. file, so, in effect, command line options can be used to over-ride the
  447. defaults in your
  448. .B .serc
  449. file.
  450. .PP
  451. .BR NOTE :
  452. Commands in the
  453. .B .serc
  454. file do
  455. .I not
  456. go through that part of
  457. .I se
  458. which processes the special control characters (see below), so
  459. .I do not
  460. use them in your
  461. .B .serc
  462. file.
  463. .PP
  464. .B Commands
  465. .PP
  466. .TP
  467. (.)\^a\^[:text]  Append
  468. If the command is followed immediately by a colon, then
  469. whatever text follows the colon is inserted without entering
  470. \*(lqappend\*(rq mode.
  471. .TP
  472. (.,.)\^c\^[:text]  Change
  473. If the command is followed immediately by a colon, then
  474. whatever text follows the colon is inserted in place of the named lines
  475. without entering \*(lqappend\*(rq mode.
  476. .TP
  477. (.,.)\^d  Delete
  478. .TP
  479. e\^[\*(lq!\*(rq\^|\^\*(lqx\*(rq] [filename]  Enter
  480. \*(lqe!\*(rq, enter now, is the same as \*(lqE\*(rq in
  481. .IR ed .
  482. \*(lqex\*(rq enters the file with \*(lqXTABS\*(rq turned on, i.e. expand any tabs to
  483. blanks.  File names with extensions \*(lqs\*(rq, \*(lqc\*(rq, \*(lqh\*(rq, \*(lqf\*(rq and \*(lqr\*(rq, are
  484. automatically entered with \*(lqXTABS\*(rq turned on.
  485. .TP
  486. f [filename]  File
  487. .TP
  488. (.,$)\^g/reg expr/command  Global on pattern
  489. .TP
  490. none h\^[stuff] Help
  491. This command provides access to on-line documentation on
  492. the screen editor.
  493. \*(lqStuff\*(rq may be used to select which information is displayed.
  494. The help command will display information which is correct
  495. for both UNIX and SWT modes.
  496. .TP
  497. (.)\^i\^[:text]  Insert
  498. If the command is immediately followed by a colon, then
  499. whatever text follows is inserted without entering \*(lqappend\*(rq mode.
  500. The current line pointer is left at the last line inserted.
  501. .TP
  502. (^,.)\^j\^[\^/stuff\^[\^/\^]\^]     Join
  503. Join is basically the same in
  504. .IR se " and " ed
  505. except if no line numbers are specified, the default
  506. is to join the previous line with the current line (as opposed
  507. to the current line and the next line), and
  508. .I se
  509. allows you to indicate what is to replace the newline(s) in \*(lqstuff\*(rq.
  510. The default is a single blank.  If you do specify \*(lqstuff\*(rq, the trailing
  511. delimiter is optional. \*(lqj/\*(rq is considered the same as \*(lqj//\*(rq,
  512. i.e., the newline is deleted.
  513. .TP
  514. (.,.)\^k\^[m]   marK
  515. .I Se
  516. allows marks to be any
  517. single character other than a newline. If \*(lqm\*(rq is not
  518. present, the lines are marked with the default name of blank.
  519. .RI ( Ed
  520. allows only lower case letters to be marks.)
  521. .TP
  522. none  l  Locate
  523. The Locate command places the system name into the status line
  524. (e.g. \*(lqgatech\*(rq or \*(lqgitpyr\*(rq).
  525. This is so that one
  526. can tell what machine he is using from within the screen
  527. editor. This is particularly useful for installations with
  528. many machines that can run the editor, where the user can
  529. switch back and forth between them, and become confused as
  530. to where he is at a given moment.
  531. .TP
  532. (.,.)\^m\^<line>     Move
  533. .TP
  534. (.,.)\^n\^[m]  Name
  535. If \*(lqm\*(rq is present, the last line in the
  536. specified range is marked with it and all other lines having that
  537. mark name are given the default mark name of blank.
  538. If \*(lqm\*(rq is not
  539. present,
  540. the names of all lines in the range are cleared.
  541. .TP
  542. none  o\^[stuff]  Option
  543. Editing options may be queried or set.  \*(lqStuff\*(rq determines which
  544. options are affected.
  545. Options for 
  546. .I se
  547. can be specified in three ways;
  548. in the
  549. .B .serc
  550. file, on the command line that invokes
  551. .IR se ,
  552. or with the \*(lqo\*(rq command.
  553. To specify an option
  554. with the \*(lqo\*(rq command, just enter \*(lqo\*(rq followed immediately by
  555. the option letter and its parameters.  To specify an option on the
  556. command line, just use \*(lq\-\*(rq followed by the option letter and its
  557. parameters.
  558. With this second method, if there are imbedded spaces in the parameter
  559. list, the entire option should be enclosed in quotes.  For
  560. example, to specify the \*(lqa\*(rq (absolute line number) option
  561. and tab stops at column 8 and every fourth thereafter with the
  562. \*(lqo\*(rq command, just enter
  563. .sp
  564. .CW
  565. oa
  566. ot 8 +4
  567. .CN
  568. .sp
  569. when
  570. .I se
  571. is waiting for a command.
  572. To enter the same options on the invoking command line, you might
  573. use
  574. .sp
  575. .CW
  576. se myfile -a "-t 8 +4"
  577. .CN
  578. .sp
  579. You may also choose to put options that you will always want into
  580. your
  581. .B .serc
  582. file.  Commands in the
  583. .B .serc
  584. file should look exactly the same
  585. as they would if they were typed at the command line.
  586. Command line options will always over-ride option
  587. commands given in your
  588. .B .serc
  589. file.
  590. .sp
  591. The following summarizes the available
  592. .I se
  593. options:
  594. .RS
  595. .TP
  596. a
  597. causes absolute line numbers to be displayed in the line number area
  598. of the screen. The default behavior is to display upper-case letters
  599. with the letter \*(lqA\*(rq corresponding to the first line in the window.
  600. .TP
  601. c
  602. inverts the case of all letters you type (i.e., converts
  603. upper-case to lower-case and vice versa). This option causes
  604. commands to be recognized only in upper-case and alphabetic line
  605. numbers to be displayed and recognized only in lower-case.
  606. In this mode,
  607. .I se
  608. displays the line number letters in lower case
  609. and expects its command letters in upper case.  Unshifted letters
  610. from the terminal are converted to upper case and shifted
  611. letters to lower case.
  612. .TP
  613. d\^[<dir>]
  614. selects the placement of the current line pointer following
  615. a \*(lqd\*(rq (delete) command. <dir> must be either \*(lq>\*(rq or \*(lq<\*(rq.
  616. If \*(lq>\*(rq is specified, the default behavior is
  617. selected: the line following the deleted lines becomes the new
  618. current line.  If \*(lq<\*(rq is specified, the line immediately preceding
  619. the deleted lines becomes the new current line.  If neither is
  620. specified, the current value of <dir> is displayed in the status
  621. line.
  622. .TP
  623. f
  624. selects Fortran oriented options. This is equivalent to specifying
  625. the \*(lqt7 +3\*(rq option, and \*(lqXTABS\*(rq is turned on (i.e.
  626. tabs are expanded).
  627. (On the primes, this would also turn on the \*(lqc\*(rq option, however the
  628. .SM UNIX
  629. fortran compiler,
  630. .IR f77 (1),
  631. only recognizes lower case input.)
  632. .TP
  633. g
  634. controls the behavior of the \*(lqs\*(rq (substitute) command
  635. when it is under the control of a \*(lqg\*(rq (global) command.
  636. Initially, if a substitute inside a global command fails,
  637. .I se
  638. will not continue with the rest of the lines which might succeed.
  639. If \*(lqog\*(rq is given, then the global substitute will continue, and lines
  640. which failed will not be affected.
  641. Successive \*(lqog\*(rq commands will toggle this behavior.
  642. An explanatory message is placed in the status line.
  643. .TP
  644. h
  645. controls the use of hardware line insert/delete
  646. on terminals that have that capability.
  647. By default, line insert/delete will be used if available.
  648. It is occasionally useful to turn this option off when using the
  649. editor on a terminal which can't keep up, or if the communications
  650. lines may be scrambling the control characters.
  651. Each successive \*(lqoh\*(rq merely toggles a switch within the editor.
  652. An explanatory message is placed in the status line.
  653. .TP
  654. i\^[a | <indent>]
  655. selects indent value for lines inserted with \*(lqa\*(rq, \*(lqc\*(rq and \*(lqi\*(rq commands
  656. (initially 1).
  657. \*(lqa\*(rq selects auto-indent which sets the indent to the value which
  658. equals the indent of the previous line.
  659. If neither \*(lqa\*(rq nor \*(lq<indent>\*(rq are specified, the current value of
  660. indent is displayed.
  661. .TP
  662. k
  663. indicates whether the current contents of your edit buffer
  664. have been saved or not by printing either a \*(lqsaved\*(rq or
  665. \*(lqnot saved\*(rq message on your status line.
  666. .TP
  667. l\^[<lop>]
  668. sets the line number display option.
  669. Under control of this option, 
  670. .I se
  671. continuously displays
  672. the value of one of three symbolic line numbers.
  673. <lop> may be \*(lq.\*(rq, \*(lq#\*(rq, or \*(lq$\*(rq.
  674. If <lop> is omitted, the line number display is disabled.
  675. .TP
  676. lm\^[<col>]
  677. sets the left margin to <col> which must be a positive integer.
  678. This option will `shift' your entire screen to the left,
  679. enabling you to see characters at the end of the line that
  680. were previously off the screen; the characters in columns
  681. 1 through <col> \- 1 will not be visible.  You may continue
  682. editing in the normal fashion.  To reset your screen enter
  683. the command \*(lqolm 1\*(rq.
  684. If <col> is omitted, the current left margin column
  685. is displayed in the status line.
  686. .TP
  687. m
  688. controls notification of
  689. the presence of existing mail
  690. and/or
  691. the arrival of new mail
  692. in the user's mail file. 
  693. The mail file is taken from the \*(lqMAIL\*(rq shell variable in the user's
  694. environment.
  695. On startup, if the mail file is not empty,
  696. .I se
  697. will remark,
  698. \*(lqYou have mail.\*(rq
  699. Then, if new mail arrives,
  700. .I se
  701. will remark,
  702. \*(lqYou have new mail,\*(rq
  703. and ring the terminal's bell.
  704. The \*(lqm\*(rq option simply toggles a notification switch, so that
  705. the user can turn off this notification.
  706. The \*(lqom\*(rq command displays the current setting of the notify
  707. switch in the status line.
  708. .TP
  709. p\^[s | u]
  710. converts to or from SWT compatibility mode.
  711. The \*(lqop\*(rq command, by itself, will toggle between SWT mode and UNIX mode.
  712. When running at the I.C.S. school at Georgia Tech,
  713. .I se
  714. automagically comes up in SWT mode.
  715. The command \*(lqopu\*(rq will force
  716. .I se
  717. to use UNIX mode, while the command \*(lqops\*(rq will force
  718. .I se
  719. to use SWT mode.
  720. During initialization,
  721. .I se
  722. simply checks if it is running at the I.C.S. school at Georgia Tech,
  723. and if it is, it executes an \*(lqops\*(rq.
  724. (The editor checks if the site name is one of
  725. \*(lqgatech\*(rq,
  726. \*(lqstratus\*(rq,
  727. \*(lqnimbus\*(rq,
  728. or
  729. \*(lqcirrus\*(rq.
  730. If it is, then it figures it is running at the I.C.S. school.
  731. These machines are the CSnet and Clouds Project Vaxes.
  732. .I Se
  733. also knows about the \*(lqgt-\*(rq prefix convention
  734. for Georgia Tech machine names.
  735. The site name of your machine can be checked with the \*(lql\*(rq command.)
  736. .sp
  737. When in SWT mode,
  738. .I se
  739. uses the following for its patterns and commands:
  740. .RS
  741. .TP
  742.  \epattern[\e]
  743. searches backwards for a pattern.
  744. .TP
  745.  %
  746. matches the beginning of a line.
  747. .TP
  748.  ?
  749. matches any character.
  750. .TP
  751.  ~
  752. is used to negate character classes.
  753. .TP
  754.  &
  755. used by itself in the replacement part of a substitute command
  756. represents the replacement part of the previous substitute command.
  757. Otherwise, it represents the matched search pattern. This last is the
  758. same behavior as in Unix mode.
  759. When used by itself in the replacement part of a transliterate command,
  760. it represents the replacement part of the previous transliterate command.
  761. .TP
  762.  {<regular expression>}
  763. tags pieces of a pattern.
  764. .TP
  765.  @<digit>
  766. represents the text matched by the tagged sub-pattern
  767. specified by <digit>.
  768. .TP
  769.  @
  770. is the escape character, instead of \e.
  771. .TP
  772.  y
  773. copies lines.
  774. .TP
  775.  t
  776. transliterates characters.
  777. .TP
  778.  !
  779. does the global exclude on markname (see the \*(lq~\*(rq command, below).
  780. .TP
  781.  ~[<\s-1UNIX\s+1 Command>]
  782. will fork a shell, or execute <\s-1UNIX\s+1 command> if it is present
  783. (see the \*(lq!\*(rq command, below).
  784. .PP
  785. All other characters and commands are the same for both SWT and UNIX mode.
  786. The help command will always call up documentation appropriate
  787. to the current mode.
  788. .RE
  789. .TP
  790. s\^[d | data | as | s | c | h | n | nr | nroff | p | r | f]
  791. sets other options for case, tabs, etc., for
  792. data files, \*(lqd\*(rq or \*(lqdata\*(rq,
  793. assembly files, \*(lqas\*(rq or \*(lqs\*(rq,
  794. C files, \*(lqc\*(rq,
  795. `include' files \*(lqh\*(rq,
  796. nroff files, \*(lqn\*(rq or \*(lqnr\*(rq or \*(lqnroff\*(rq,
  797. ratfor files, \*(lqr\*(rq,
  798. pascal files, \*(lqp\*(rq,
  799. and fortran files, \*(lqf\*(rq.
  800. Options set for data and nroff files are \*(lqow74\*(rq and \*(lqot+4\*(rq;
  801. for assembly files \*(lqot 17+8\*(rq and \*(lqXTABS\*(rq is turned on;
  802. for C, include, pascal and ratfor files
  803. \*(lqow74\*(rq, \*(lqot+4\*(rq and \*(lqXTABS\*(rq is turned on;
  804. for fortran files
  805. \*(lqot 7+3\*(rq and \*(lqXTABS\*(rq is turned on.
  806. If \*(lqXTABS\*(rq is turned on then tabs are expanded.
  807. If no argument is specified the options effected by this
  808. command revert to their default value.
  809. .TP
  810. t\^[<tabs>]
  811. sets tab stops according to <tabs>.  <tabs> consists of
  812. a series of numbers indicating columns in which tab stops
  813. are to be set.  If a number is preceded by a plus sign (\*(lq+\*(rq),
  814. it indicates that the number is an increment; stops are set
  815. at regular intervals separated by that many columns, beginning with
  816. the most recently specified absolute column number.  If no such
  817. number precedes the first increment specification, the stops are
  818. set relative to column 1.
  819. By default, tab stops are set in every third column starting with
  820. column 1, corresponding to a <tabs> specification of \*(lq+3\*(rq.
  821. If <tabs> is omitted, the current tab spacing is
  822. displayed in the status line. Examples
  823. .sp
  824. .CW
  825. ot 1 4 7 10 13 16 19 22 25 28 31 34  ...
  826. ot +3
  827. ot 7 +3
  828. .CN
  829. .sp
  830. Once the tab stops are set, the control-i and control-e keys
  831. can be used to move the cursor from its current position forward or
  832. backward to the nearest stop, respectively.
  833. .TP
  834. u\^[<chr>]
  835. Normally,
  836. .I se
  837. displays a non-printing character (e.g. \s-1NEWLINE\s+1, \s-1TAB\s+1 ...)
  838. as a blank.
  839. With this option, you can
  840. select the character that
  841. .I se
  842. displays in place of 
  843. unprintable characters.  <chr> may be any printable character.
  844. If <chr> is omitted,
  845. .I se
  846. displays the current replacement character on the status line.
  847. Non-printing characters (such as
  848. .I se
  849. control characters), or any others for that matter,
  850. may be entered by hitting the
  851. .SM ESC
  852. key followed immediately by the
  853. key to generate the desired character.
  854. Note, however, that the character you type is taken literally,
  855. exactly as it is generated by your terminal, so case conversion
  856. does not apply.
  857. .TP
  858. v\^[<col>]
  859. sets the default \*(lqoverlay column\*(rq.  This is the column
  860. at which the cursor is initially positioned by the \*(lqv\*(rq command.
  861. <Col> must be a positive integer, or a dollar sign ($) to indicate
  862. the end of the line.  If <col> is omitted, the current overlay
  863. column is displayed in the status line.
  864. .TP
  865. w\^[<col>]
  866. sets the \*(lqwarning threshold\*(rq to <col> which must be
  867. a positive integer. Whenever the cursor is  positioned at or
  868. beyond this column, the column number is displayed in the status
  869. line and the terminal's bell is sounded.
  870. If <col> is omitted, the current warning threshold is displayed
  871. in the status line.
  872. The default warning threshold is 74, corresponding to the first column
  873. beyond the right edge of the screen on an 80 column crt.
  874. .TP
  875. x
  876. toggles tab compression and expansion (\*(lqXTABS\*(rq).
  877. If XTABS is off, \*(lqox\*(rq
  878. turns it on for subsequent \*(lqr\*(rq,
  879. and \*(lqw\*(rq, commands.
  880. Be aware that the \*(lqe\*(rq
  881. command checks the source option for files;
  882. use the \*(lqex\*(rq command to force
  883. tab expansion.
  884. .TP
  885. y\^[<key>]
  886. allows you to edit encrypted files. \*(lqoy\*(rq followed by a key
  887. will cause the
  888. \*(lqe\*(rq, \*(lqr\*(rq, and \*(lqw\*(rq
  889. commands to encrypt and decrypt files using
  890. .IR crypt (1).
  891. \*(lqoy\*(rq by itself will toggle the current encryption setting.
  892. If there is no current key,
  893. .I se
  894. will ask you for one.
  895. Echoing is turned off while you type your key in, and
  896. .I se
  897. asks you to type it in twice, just to be sure.
  898. If encryption is turned on, and you type a plain \*(lqoy\*(rq, it will be turned off.
  899. Note that doing so causes
  900. .I se
  901. to forget the value of the encryption key.
  902. Encryption in indicated by the message
  903. \*(lqENCRYPT\*(rq in the status line.
  904. The key is
  905. .I never
  906. shown on your screen.
  907. .TP
  908. z
  909. suspends the editor (puts it in the background)
  910. and returns to the user's shell (either
  911. .BR /bin/csh ,
  912. or, on
  913. .SM "BRL UNIX"
  914. systems,
  915. .BR /bin/sh
  916. with job control turned on (the \-J option)).
  917. The editor will warn you if the edit buffer has not been saved.
  918. This is the
  919. .I only
  920. way to suspend the editor; the editor uses control-z for its own purposes
  921. (see the section on control characters, below).
  922. If you normally run
  923. .B /bin/sh
  924. without job control,
  925. this command has no effect at all.
  926. .sp
  927. At the I.C.S. school at Georgia Tech
  928. .IR only ,
  929. if the shell environment variable \*(lqRSE\*(rq exists, you will not be
  930. allowed to suspend the editor.
  931. This is so that users with mail\-only logins may edit their files,
  932. but not do anything else (see the \*(lq!\*(rq command, below).
  933. This does not apply if
  934. .I se
  935. is running at someplace other than the I.C.S. school at Georgia Tech.
  936. .sp
  937. On
  938. .SM UNIX
  939. systems without the Berkeley job control mechanism, this option
  940. will be recognized, but will have no effect.
  941. Instead, an explanatory message will be placed in the status line.
  942. .TP
  943. \-[<lnr>]
  944. splits the screen at the line specified by <lnr> which must
  945. be a simple line number within the current window.  All lines above
  946. <lnr> remain frozen on the screen, the line specified by <lnr> is
  947. replaced by a row of dashes, and the space below this row becomes
  948. the new window on the file. Further editing commands do not affect the
  949. lines displayed in the top part of the screen.  If <lnr> is
  950. omitted, the screen is restored to its full size.
  951. .RE
  952. .TP
  953. (.,.)\^p  Print
  954. Prints all the lines in the given range.
  955. As much as possible of the range is displayed, always
  956. including the last line; if no range is given, the previous
  957. page is displayed.
  958. The current line pointer is left at the last line printed.
  959. .TP
  960. q\^[!]  Quit
  961. \*(lqq!\*(rq, exit immediately, is the same as \*(lqQ\*(rq in 
  962. .IR ed .
  963. .TP
  964. r\^[x] [filename]  Read
  965. If no line number is specified, the named file is read starting after current
  966. line (as opposed to
  967. .I ed
  968. where the file is read at the end of the edit buffer).
  969. \*(lqrx\*(rq causes tabs to be expanded in the lines read.
  970. .TP
  971. (.,.)\^s\^[\^/reg expr/sub\^[/]\^[g]\^[p]]     Substitute
  972. If no pattern and replacement are specified after the \*(lqs\*(rq,
  973. .I se
  974. will behave as if you had typed \*(lqs//%/\*(rq, i.e. for the
  975. saved search pattern, substitute the saved replacement pattern.
  976. To just delete a pattern, you may type \*(lqs/stuff\*(rq, and
  977. .I se
  978. will behave as if you had typed \*(lqs/stuff//\*(rq.
  979. .TP
  980. (.,.)t<n>   Copy
  981. (\*(lqTo\*(rq is the
  982. .I ed
  983. mnemonic).
  984. .TP
  985. u\^[d]  Undo
  986. \*(lqu\*(rq undoes the effects of the previous command, on the
  987. .I last line
  988. affected (for instance a substitute command).
  989. \*(lqud\*(rq undoes the last delete, i.e. it inserts the last deleted line
  990. after the current line.
  991. .I Se
  992. does not have a global undo capability.
  993. .TP
  994. (.,.)\^v   oVerlay \(em screen oriented editing
  995. Full screen editing with
  996. .I se
  997. is accomplished through the
  998. use of control characters for editing functions.
  999. With screen oriented editing,
  1000. control characters may
  1001. be used to modify text anywhere in the buffer.
  1002. A control-v
  1003. may be used to quit overlay mode.
  1004. A control-f
  1005. may be used to restore the current line to its original state and
  1006. terminate the command.
  1007. Since
  1008. .I se
  1009. supports such a large number of
  1010. control functions, the mnemonic value of control character
  1011. assignments has dwindled to almost zero.  About the only thing
  1012. mnemonic is that most symmetric functions
  1013. have been assigned to opposing keys on the keyboard  (e.g.,
  1014. forward and backward tab to control-i and control-e, forward
  1015. and backward space to control-g and control-h, skip right
  1016. and left to control-o and control-w, and so on).
  1017. We feel pangs of conscience about this, but can find no
  1018. more satisfactory alternative.
  1019. If you feel the control character assignments are terrible and
  1020. you can find a better way, you may change them by modifying
  1021. the definitions in
  1022. .I se
  1023. and recompiling.
  1024. .sp
  1025. Except for a few special purpose ones, control characters
  1026. can be used anywhere, even on the command line.  (This is why
  1027. erroneous commands are not erased \(em you may want to edit
  1028. them.)  Most of the functions work on a single line,
  1029. but the cursor may be
  1030. positioned anywhere in the buffer.
  1031. Refer to the next section which describes each control character
  1032. in detail.
  1033. .TP
  1034. (1,$)\^w\^[+ | > | !] [filename]  Write
  1035. Write the portion of the buffer specified
  1036. to the named file.
  1037. If \*(lq+\*(rq or \*(lq>\*(rq is given, the portion of the
  1038. buffer is appended to the file; otherwise the portion of
  1039. the buffer replaces the file.
  1040. \*(lqw!\*(rq, write immediately, is the same as \*(lqW\*(rq in
  1041. .IR ed .
  1042. .TP
  1043. (1,$)\^x\^/reg expr/command     eXclude on reg expr
  1044. .TP
  1045. (.,.)\^y\^[\^/from/to\^[/]\^[p]]  TranslYterate (sic)
  1046. The range of characters
  1047. specified by \*(lqfrom\*(rq is transliterated into the range of
  1048. characters specified by \*(lqto\*(rq. The last line on which something
  1049. was transliterated is printed if the \*(lqp\*(rq option is used.
  1050. The last line in the range becomes the new current line.
  1051. As with the substitute and join commands, and pattern searches, the
  1052. trailing delimiter is optional.
  1053. .I Se
  1054. saves both the \*(lqfrom\*(rq and \*(lqto\*(rq parts of the transliterate command:
  1055. \*(lqy\*(rq is the same as \*(lqy//%/\*(rq, i.e. transliterate the saved \*(lqfrom\*(rq range
  1056. into the saved \*(lqto\*(rq range.
  1057. The \*(lq%\*(rq is special only if it is the only character
  1058. in the \*(lqto\*(rq part of the command.
  1059. .TP
  1060. (.,.)\^zb\^<left>\^[,<right>]\^[<char>]  Draw Box
  1061. A box is drawn on the given lines, in the given columns,
  1062. using the given <char>.
  1063. This command can be used as an aid for preparing block diagrams,
  1064. flowcharts, or tables.
  1065. .sp
  1066. Line numbers are used to specify top and bottom row positions of the box.
  1067. <Left> and <right> specify left and right column positions of the box.
  1068. If second line number is omitted, the box degenerates to a horizontal
  1069. line.
  1070. If right-hand column is omitted, the box degenerates to a vertical line.
  1071. If <char> is omitted, it defaults to blank,
  1072. allowing erasure of a previously-drawn box.
  1073. .sp
  1074. For example, \*(lq1,10zb15,25*\*(rq would draw a box 10 lines high
  1075. and 11 columns across, using asterisks.
  1076. The upper left corner of the box would be on line 1, column 15,
  1077. and the lower right corner on line 10, column 25.
  1078. .TP
  1079. (.)\^=  Equals what line number?
  1080. .TP
  1081. (1,$)\^~m\^command  global exclude on markname
  1082. Similar to the \*(lqx\*(rq prefix except that
  1083. \*(lqcommand\*(rq is performed for all lines in the range that do not have the
  1084. mark name \*(lqm\*(rq.
  1085. .TP
  1086. changequote([])
  1087. (1,$)\^'m\^command  global on markname
  1088. changequote
  1089. Similar to the \*(lqg\*(rq prefix except that
  1090. \*(lqcommand\*(rq is performed for all lines in the range that have the
  1091. mark name \*(lqm\*(rq.
  1092. .TP
  1093. (.)\^:   display next page
  1094. The next page of the
  1095. buffer is displayed and the current line pointer is placed at
  1096. the top of the window.
  1097. .TP
  1098. changequote({})
  1099. none ![<\s-1UNIX\s+1 command>]   escape to the shell.
  1100. The user's choice of shell is taken from the \*(lqSHELL\*(rq environment
  1101. variable (if it exists),
  1102. and is used to execute <\s-1UNIX\s+1 command> if it is present. Otherwise, an
  1103. interactive shell is created.
  1104. After an interactive shell exits, the screen is immediately redrawn.
  1105. If a command was run, the results are left on the screen, and the
  1106. user must type
  1107. .SM RETURN
  1108. to redraw the editing window.
  1109. This is how
  1110. .IR vi (1)
  1111. behaves.
  1112. If the first character of the <\s-1UNIX\s+1 command> is a `!' (regardless of the
  1113. current mode, SWT or UNIX), then the `!' is replaced with the text of
  1114. the previous shell command.
  1115. An unescaped `%' in the <\s-1UNIX\s+1 command> will be replaced with the current
  1116. saved file name.
  1117. If the shell command is expanded,
  1118. .I se
  1119. will echo it first, and then execute it.
  1120. This behavior is identical to the version of
  1121. changequote
  1122. .I ed
  1123. in `USG'
  1124. .SM UNIX
  1125. 5.0 (also known as
  1126. .SM UNIX
  1127. System V).
  1128. .sp
  1129. At the I.C.S. school at Georgia Tech
  1130. .IR only ,
  1131. if the shell environment variable \*(lqRSE\*(rq exists,
  1132. .I se
  1133. will not allow you to fork a shell.
  1134. The editor behaves this way to allow users who have mail\-only privileges
  1135. to be able to edit their messages, without having access to any
  1136. other resources.  This does not apply when
  1137. .I se
  1138. is running someplace other than the I.C.S. school at Georgia Tech.
  1139. .SS Control Characters
  1140. .PP
  1141. The set of control characters defined below can be used for correcting
  1142. mistakes while typing regular editing commands, for correcting commands
  1143. that have caused an error message to be displayed, for correcting lines
  1144. typed in append mode, or for in-line editing using the \*(lqv\*(rq command.
  1145. .TP
  1146. control-a
  1147. Toggle insert mode.  The status of the insertion indicator
  1148. is inverted.
  1149. Insert mode, when enabled, causes the characters you type to be
  1150. inserted at the current cursor position in the line
  1151. instead of overwriting the characters that were there
  1152. previously.  When insert mode is in effect, \*(lqINSERT\*(rq appears
  1153. in the status line.
  1154. .TP
  1155. control-b
  1156. Scan right and erase.  The current line is scanned from the current
  1157. cursor position to the right margin until an occurrence of the
  1158. next character typed is found.  When the character is found, all
  1159. characters from the current cursor position up to (but not including)
  1160. the scanned character are deleted and the remainder of the line
  1161. is moved to the left to close the gap.  The cursor is left in
  1162. the same column which is now occupied by the scanned character.
  1163. If the line to the right of the cursor does not contain the character
  1164. being sought, the terminal's bell is sounded.
  1165. .I Se
  1166. remembers the last character that was scanned using this
  1167. or any of the other scanning keys;
  1168. if control-b is hit twice in a row, this remembered character is
  1169. used instead of a literal control-b.
  1170. .TP
  1171. control-c
  1172. Insert blank.  The characters at and to the right of
  1173. the current cursor position are moved to the right one column
  1174. and a blank is inserted to fill the gap.
  1175. .TP
  1176. control-d
  1177. Cursor up.  The effect of this key depends on
  1178. .IR se 's
  1179. current mode.  When in command mode, the current line pointer is moved
  1180. to the previous line without affecting the contents of the command
  1181. line.  If the current line pointer is at line 1, the last line
  1182. in the file becomes the new current line.
  1183. In overlay mode (viz. the \*(lqv\*(rq command), the cursor is
  1184. moved up one line while remaining in the same column.
  1185. In append mode, this key is ignored.
  1186. .TP
  1187. control-e
  1188. Tab left.  The cursor is moved to the nearest tab stop
  1189. to the left of its current position.
  1190. .TP
  1191. control-f
  1192. \*(lqFunny\*(rq return.  The effect of this key depends on the
  1193. editor's current mode. In command mode, the current command line is
  1194. entered as\-is, but is not erased upon completion of the
  1195. command; in append mode, the current line is duplicated; in
  1196. overlay mode (viz. the \*(lqv\*(rq command), the current line is restored
  1197. to its original state and command mode is reentered (except if
  1198. under control of a global prefix).
  1199. .TP
  1200. control-g
  1201. Cursor right.  The cursor is moved one column to the right.
  1202. .TP
  1203. control-h
  1204. Cursor left.  The cursor is moved one column to the left.
  1205. Note that this
  1206. .I does not
  1207. erase any characters; it simply moves the cursor.
  1208. .TP
  1209. control-i
  1210. Tab right.
  1211. The cursor is moved to the next tab stop to the right of its current
  1212. position.
  1213. Again, no characters are erased.
  1214. .TP
  1215. control-k
  1216. Cursor down.  As with the control-d key, this key's effect depends
  1217. on the current editing mode.  In command mode,  the current line pointer
  1218. is moved to the next line without changing the contents of the command
  1219. line. If the current line pointer is at the last line in the file,
  1220. line 1 becomes the new current line.  In overlay mode (viz. the
  1221. \*(lqv\*(rq command), the cursor is moved down one line while remaining in the
  1222. same column.  In append mode, control-k has no effect.
  1223. .TP
  1224. control-l
  1225. Scan left.  The cursor is positioned according to the character
  1226. typed immediately after the control-l.  In effect, the current line is
  1227. scanned, starting from the current cursor position and moving left,
  1228. for the first occurrence of this character.  If none is found before
  1229. the beginning of the line is reached, the scan resumes with the
  1230. last character in the line.  If the line does not contain the character
  1231. being looked for, the message \*(lqNOT FOUND\*(rq is printed in the status line.
  1232. .I Se
  1233. remembers the last character
  1234. that was scanned for using this key; if the control-l is hit twice in
  1235. a row, this remembered character is searched for instead of a literal
  1236. control-l.
  1237. Apart from this, however, the character typed after control-l is taken
  1238. literally, so
  1239. .IR se 's
  1240. case conversion feature does not apply.
  1241. .TP
  1242. control-m
  1243. Kill right and terminate; identical to the
  1244. .SM NEWLINE
  1245. key described below.
  1246. .TP
  1247. control-n
  1248. Scan left and erase.
  1249. The current line is scanned from the current cursor position to the
  1250. left margin until an occurrence of the next character typed is found.
  1251. Then that character and all characters to its right up to
  1252. (but not including) the character under the cursor are erased.
  1253. The remainder of the line, as well as the cursor are moved to the
  1254. left to close the gap.  If the line to the left of the cursor
  1255. does not contain the character being sought, the terminal's bell is
  1256. sounded.
  1257. If control-n is hit twice in a row, the last character scanned for is
  1258. used instead of a literal control-n.
  1259. .TP
  1260. control-o
  1261. Skip right.  The cursor is moved to the first position beyond
  1262. the current end of line.
  1263. .TP
  1264. control-p
  1265. Interrupt.  If executing any command except \*(lqa\*(rq, \*(lqc\*(rq, \*(lqi\*(rq or
  1266. \*(lqv\*(rq,
  1267. .I se
  1268. aborts the command and reenters command mode.  The command
  1269. line is not erased.
  1270. This is the only way to interrupt the editor.
  1271. .I Se
  1272. ignores the
  1273. .SM SIGQUIT
  1274. signal (see
  1275. .IR signal (2));
  1276. in fact it disables generating
  1277. quits from the terminal.  The editor uses
  1278. .SM "ASCII FS"
  1279. (control-\e) for its
  1280. own purposes, and changes the terminal driver to make control-p be the
  1281. interrupt character.
  1282. .TP
  1283. ifelse(GITVAX,YES, control-q, control-])
  1284. Fix screen.
  1285. The screen is reconstructed from
  1286. .IR se 's
  1287. internal representation of the screen.
  1288. .TP
  1289. control-r
  1290. Erase right.  The character at the current cursor position
  1291. is erased and
  1292. all characters to its right are moved left one position.
  1293. .TP
  1294. ifelse(GITVAX,YES, control-s, control-j)
  1295. Scan right.  This key is identical to the control-l key
  1296. described above, except that the scan proceeds to the right from
  1297. the current cursor position.
  1298. .TP
  1299. control-t
  1300. Kill right.  The character at the current cursor position
  1301. and all those to its right are erased.
  1302. .TP
  1303. control-u
  1304. Erase left.  The character to the left of the current cursor
  1305. position is deleted and all characters to its right are moved
  1306. to the left to fill the gap.  The cursor is also moved left one
  1307. column, leaving it over the same character.
  1308. .TP
  1309. control-v
  1310. Skip right and terminate. The cursor is moved to the current
  1311. end of line and the line is terminated.
  1312. .TP
  1313. control-w
  1314. Skip left.  The cursor is positioned at column 1.
  1315. .TP
  1316. control-x
  1317. Insert tab.  The character under the cursor is moved
  1318. right to the next tab stop; the gap is filled with blanks.
  1319. The cursor is not moved.
  1320. .TP
  1321. control-y
  1322. Kill left.  All characters to the left of the cursor are
  1323. erased; those at and to the right of the cursor are moved
  1324. to the left to fill the void.  The cursor is left in column 1.
  1325. .TP
  1326. control-z
  1327. Toggle case conversion mode.  The status of the case conversion
  1328. indicator is inverted; if case inversion was on, it is turned off,
  1329. and vice versa.
  1330. Case inversion, when in effect, causes all upper case letters to
  1331. be converted to lower case, and all lower case letters to be
  1332. converted to upper case (just like the alpha-lock key on some terminals).
  1333. You can type control-z at any time
  1334. to toggle the case conversion mode.  When case inversion is in effect,
  1335. .I se
  1336. displays the word \*(lqCASE\*(rq in the status line.
  1337. Note that
  1338. .I se 
  1339. continues
  1340. to recognize alphabetic line numbers in upper case only, in contrast
  1341. to the \*(lqcase inversion\*(rq option (see the description of options under the
  1342. option command).
  1343. ifelse(BSD,NO,`divert(-1)',)
  1344. .sp
  1345. Also note that when running the C-shell,
  1346. .BR /bin/csh ,
  1347. or a Bourne shell with job control (e.g. the
  1348. .B /bin/sh
  1349. supplied with
  1350. .SM "BRL UNIX\\c"
  1351. )
  1352. the only way to
  1353. suspend (stop) the editor is with the \*(lqoz\*(rq command
  1354. (see the options command, \*(lqoz\*(rq, above).
  1355. ifelse(BSD,NO,divert,)
  1356. .TP
  1357. control-_ (\s-1US\s+1)
  1358. Insert newline.  A newline character is inserted before
  1359. the current cursor position, and the cursor is moved one position
  1360. to the right.  The newline is displayed according to the current
  1361. non-printing replacement character (see the \*(lqu\*(rq option).
  1362. .TP
  1363. control-\e (\s-1FS\s+1)
  1364. Tab left and erase.
  1365. Characters are erased starting with the character at the nearest tab
  1366. stop to the left of the cursor up to but not including             
  1367. the character under the cursor.  The rest of the line,
  1368. including the cursor, is moved to the left to close the gap.
  1369. .sp
  1370. Use control-p to interrupt the editor.
  1371. .TP
  1372. control-^ (control-~, \s-1RS\s+1)
  1373. Tab right and erase.
  1374. Characters are erased starting with the character under the cursor
  1375. up to but not including the character at the nearest tab stop to
  1376. the right of the cursor.  The rest of the line is then
  1377. shifted to the left to close the gap.
  1378. .TP
  1379. .SM NEWLINE
  1380. Kill right and terminate.
  1381. The characters at and to the right of the current cursor
  1382. position are deleted, and the line is terminated.
  1383. .TP
  1384. .SM DEL
  1385. Kill all.  The entire line is erased, along with any error
  1386. message that appears in the status line.
  1387. .TP
  1388. .SM ESC
  1389. Escape.  The
  1390. .SM ESC
  1391. key provides a means for entering
  1392. .IR se 's
  1393. control characters literally as text into the file.  In fact,
  1394. any character that can be generated from the keyboard is
  1395. taken literally when it immediately follows the
  1396. .SM ESC
  1397. key.
  1398. If the character is non-printing (as are all of
  1399. .IR se 's
  1400. control characters),
  1401. it appears on the screen as the current non-printing replacement character
  1402. (normally a blank \(em see the options command \*(lqou\*(rq).
  1403. .SH FILES
  1404. .TP
  1405. .B $HOME/.serc
  1406. .I se
  1407. initialization file.
  1408. .TP
  1409. .B /usr/tmp/<process id>.<sequence_number>
  1410. for scratch file.
  1411. .TP
  1412. .B ./se.hangup
  1413. where
  1414. .I se
  1415. dumps its buffer if it catches a hang-up signal.
  1416. .TP
  1417. .B /usr/local/lib/se_h/*
  1418. help scripts for the \*(lqh\*(rq command.
  1419. .SH DIAGNOSTICS
  1420. Self explanatory diagnostics appear in the status line.
  1421. .SH CAVEATS
  1422. .I Se
  1423. will
  1424. .I never
  1425. dump its buffer into an encrypted file when it
  1426. encounters a hang-up,
  1427. even if encryption was turned on at the time.
  1428. .SH SEE ALSO
  1429. .I
  1430. Software Tools,
  1431. .I
  1432. Software Tools in Pascal,
  1433. .I
  1434. Software Tools Subsystem User's Guide,
  1435. ifelse(BSD,YES,.IR csh (1)`,',)
  1436. .IR ed (1),
  1437. .IR crypt (1),
  1438. .IR scriptse (1),
  1439. .IR sh (1),
  1440. .IR vi (1),
  1441. .IR signal (2),
  1442. ifelse(HARD_TERMS,YES,`divert(-1)',)
  1443. .IR ifelse(S5R2,YES, curses (3X)`,', termlib (3)`,')
  1444. ifelse(HARD_TERMS,YES,divert,)
  1445. .IR ifelse(BSD,YES, tty (4)`,', termio (7)`,')
  1446. .IR environ (5),
  1447. ifelse(HARD_TERMS,YES,`divert(-1)',)
  1448. .IR ifelse(S5R2,YES, terminfo (4), termcap (5))
  1449. ifelse(HARD_TERMS,YES,divert,)
  1450. .SH BUGS
  1451. Can only be run from a script if the script is first passed through
  1452. .IR scriptse (1).
  1453. .PP
  1454. Tabs could be handled better.  This is because
  1455. .I se
  1456. was originally written for Prime computers.
  1457. .PP
  1458. Does not check whether or not it has been put into the background
  1459. (this is to allow
  1460. .I se
  1461. to be used with the
  1462. .SM USENET
  1463. news software, which does a poor job
  1464. of signal handling for child processes).
  1465. .PP
  1466. Occasionally flakes out the screen when doing line inserts and deletes,
  1467. due to problems within the
  1468. .IR ifelse(S5R2,YES, curses (3X), termlib (3))
  1469. package in putting out the right number of padding characters.
  1470. Type a
  1471. ifelse(GITVAX,YES, control-q, control-])
  1472. to redraw the screen.
  1473. .PP
  1474. The auto\-indent feature does not recognize a line consisting
  1475. of just blanks and then a \*(lq.\*(rq to terminate input,
  1476. when the \*(lq.\*(rq is
  1477. not in the same position as the first non-blank character of the
  1478. previous line.
  1479. ifelse(GITVAX,YES,
  1480. .PP
  1481. The use of control-s and control-q for control characters could be
  1482. considered a very poor design choice.
  1483. )
  1484. ifelse(S5R2,YES,
  1485. .PP
  1486. .I Se
  1487. does not work too well together with the
  1488. .IR shl (1)
  1489. utility`,' since if the user types a control-z`,' both of the programs
  1490. will see it`,' and
  1491. .I shl
  1492. will stop
  1493. .IR se `,'
  1494. while
  1495. .I se
  1496. will toggle the case of its input.
  1497. )
  1498. .PP
  1499. There is no global undo capability.
  1500. .PP
  1501. The help screens could use a rewrite.
  1502. SHAR_EOF
  1503. fi
  1504. echo shar: "extracting 'scriptse.1'" '(1627 characters)'
  1505. if test -f 'scriptse.1'
  1506. then
  1507.     echo shar: "will not over-write existing file 'scriptse.1'"
  1508. else
  1509. cat << \SHAR_EOF > 'scriptse.1'
  1510. .TH SCRIPTSE 1 local
  1511. .SH NAME
  1512. scriptse \- make scripts for se
  1513. .SH SYNOPSIS
  1514. .B scriptse [-d]
  1515. < script_file |
  1516. .B se
  1517. [&]
  1518. .SH DESCRIPTION
  1519. .I Scriptse
  1520. reads standard input, and writes standard output.
  1521. It is a simple filter which turns newlines ('\en') into carriage
  1522. returns ('\er') for
  1523. .IR se (1).
  1524. This allows
  1525. .I se
  1526. to be run from a prepared script.
  1527. .I Se
  1528. can then be fired off into the background, if you wish.
  1529. .PP
  1530. After each carriage return,
  1531. .I scriptse
  1532. adds an ASCII DEL character ('\e177').
  1533. This is so that command lines which fail will be erased,
  1534. and the next command can then be executed.
  1535. If it did not, command lines would get concatenated together, and they
  1536. would simply continue to fail.
  1537. Ultimately, the editor would run out of input buffer and start to
  1538. contiunuously ring the bell on the terminal.
  1539. With the DEL character, each command line is executed on its own.
  1540. .PP
  1541. .I Scriptse
  1542. takes one option, \-d.
  1543. If this option is used,
  1544. .I scriptse
  1545. will
  1546. .I not
  1547. add the ASCII DEL after each carriage return.
  1548. This is useful for program which want to turn newlines into carraige
  1549. returns, for instance when sending files across the VAX link to the
  1550. Primes.
  1551. .PP
  1552. If you do use a script, either sit back and watch it run, or redirect
  1553. the output into a file (or /dev/null, if you are confident).
  1554. .SH SEE ALSO
  1555. .IR se (1).
  1556. .SH CAVEATS
  1557. .PP
  1558. It is rather difficult to interrupt
  1559. .I se
  1560. when it is running, so editor scripts should write their
  1561. changed buffer to a new file, in case something goes wrong.
  1562. .SH BUGS
  1563. .PP
  1564. Does no checking for any of
  1565. .IR se 's
  1566. control characters.
  1567. If you put control characters into a script, you are taking your chances.
  1568. SHAR_EOF
  1569. fi
  1570. exit 0
  1571. #    End of shell archive
  1572.  
  1573.